package com.lagou.analysis.config;


import java.io.Serializable;

/**
 * 接口返回数据<统一结构类>
 * 注: 所有的结构数均会转化为 json 数据。
 */
public class Msg<T> implements Serializable {

	private Integer errorCode;
	private String msg;
	private T data;
	/**
	 * 堆栈信息, 开发阶段返回
	 */
	private Object stack;

	public Msg() {

	}

	public Msg(int code) {
		this.errorCode = code;
	}

	public Msg(T data) {
		this.errorCode = 0;
		this.data = data;
	}

	public Integer getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(Integer errorCode) {
		this.errorCode = errorCode;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public Object getStack() {
		return stack;
	}

	public void setStack(Object stack) {
		this.stack = stack;
	}
	
}